package controllers

const (
	JOB_VALID_ON      = 0
	JOB_VALID_OFF     = 1
	JOB_EXEC_EVERYDAY = 0
	JOB_EXEC_WORKDAY  = 1
	JOB_EXEC_HOLIDAY  = 2
	JOB_EXEC_ONCE     = 0
	JOB_EXEC_MORE     = 1
	JOB_STATUS_INIT   = 9
	JOB_STATUS_SUCC   = 0
	JOB_STATUS_RUN    = 1
	JOB_STATUS_FAIL   = 2
)

type TblJobCtl struct {
	JobId        string `json:"jobId" orm:"pk;column(job_id)"`
	JobName      string `json:"jobName" orm:"column(job_name)"`
	Command      string `json:"command" orm:"column(command)"`
	Cron         string `json:"cron" orm:"column(cron)"`
	ExecDay      int    `json:"execDay" orm:"column(exec_day)"`
	ExecTimes    int    `json:"execTimes" orm:"column(exec_times)"`
	Timeout      int    `json:"timeout" orm:"column(timeout)"`
	MaxFailures  int    `json:"maxFailures" orm:"column(max_failures)"`
	DependJobId  string `json:"dependJobId" orm:"column(depend_job_id)"`
	DependCustom string `json:"dependCustom" orm:"column(depend_custom)"`
	Valid        int    `json:"valid" orm:"column(valid)"`
}

type TblJobDtl struct {
	Id            int64  `json:"id" orm:"column(id)"`
	JobDate       string `json:"jobDate" orm:"column(job_date)"`
	JobId         string `json:"jobId" orm:"column(job_id)"`
	JobName       string `json:"jobName" orm:"column(job_name)"`
	Command       string `json:"command" orm:"column(command)"`
	Cron          string `json:"cron" orm:"column(cron)"`
	ExecDay       int    `json:"execDay" orm:"column(exec_day)"`
	ExecTimes     int    `json:"execTimes" orm:"column(exec_times)"`
	Timeout       int    `json:"timeout" orm:"column(timeout)"`
	MaxFailures   int    `json:"maxFailures" orm:"column(max_failures)"`
	DependJobId   string `json:"dependJobId" orm:"column(depend_job_id)"`
	DependCustom  string `json:"dependCustom" orm:"column(depend_custom)"`
	JobStatus     int    `json:"jobStatus" orm:"column(job_status)"`
	JobStatusDesc string `json:"jobStatusDesc" orm:"column(job_status_desc)"`
	CreateTime    string `json:"createTime" orm:"column(create_time)"`
	UpdateTime    string `json:"updateTime" orm:"column(update_time)"`
}

type CronRsp struct {
	ErrorCode string `json:"errorCode"`
	ErrorDesc string `json:"errorDesc"`
}
